from bigdl.llm.transformers import AutoModelForCausalLM

model_path = "Chat/Baichuan2-7B-Chat"
model = AutoModelForCausalLM.from_pretrained(model_path,
                                             load_in_4bit=True,
                                             trust_remote_code=True)
model.save_pretrained("Chat/Baichuan2-7B-Chat-4bit")
